#/bin/sh

OUTPUT=""
for i in {1..100}
do
	OUTPUT="$OUTPUT\n"$(make clean run >&1)
done

UNIQUE_OUT=$(echo -e "$OUTPUT" | grep "gdtr.base" | sort | uniq)
echo "$UNIQUE_OUT"

CPU_NUM=$(cat /proc/cpuinfo | grep "^processor" | wc -l)
GDTR_NUM=$(echo "$UNIQUE_OUT" | wc -l)
echo $CPU_NUM $GDTR_NUM
if [[ $CPU_NUM -ge $GDTR_NUM ]]; then
	echo "Seems OK"
else
	echo "Seems WRONG"
fi

